With continuous development of information technologies, electronic terminals (such as mobile phones and cameras) begin to support image processing. Electronic terminals are ubiquitously used for photographing. However, in a photographing process, for a scene with different depths of field, only a depth of field can be selected for focusing and capturing, and this causes other regions to be relatively unclear. In the prior art, a camera may be used to capture images with different depths of field, and then image fusion is performed according to a related image processing method such that a full-definition image is obtained on a display terminal.
For example, in the prior art, an image is selected from a group of multi-focus photos and copied as a target photo. Then, definitions of pixels in a same position in the target photo and other photos in the group of multi-focus photos are compared, and a highest-definition pixel is used to replace a pixel in the same position in the target photo. This technical solution only provides a fusion policy using a highest-definition pixel for replacement after capture, and is applicable only to still image processing.
For another example, a pixel-level multi-focus image fusion method based on correction of a differential image is disclosed in Chinese patent application No. 201010507977.4 in the prior art. First, down-sampling is performed on images to be fused, and spatial frequencies of the down-sampled images to be fused are calculated. Then an initial fused image is obtained by comparing the spatial frequencies. Then correction is performed twice on a differential image between the initial fused image and the down-sampled images to be fused, where the first correction uses median filtering and is used to eliminate isolated pixels that are selected incorrectly, and the second correction is to merge regions by calculating areas of the regions, and finally, interpolation amplification is performed on an obtained image that is corrected twice, a final marked image is obtained, and a fused image may be obtained according to the marked image. In this technical solution, down-sampling needs to be performed on the images, and after fusion, interpolation processing also needs to be performed. In addition, this technical solution is also applicable to still image processing only.
The image processing methods for electronic terminals in the prior art are either too simple and cause a poor image processing effect, or too complex and cause low image processing efficiency, and are generally applicable to still image processing only. People are always concerned about how to perform high-efficiency and high-quality image processing on an electronic terminal to obtain a high-definition image required by a user.